package lunchy.mvc.models;

import lunchy.data.classes.CLunchyXMLUsersDAO;
import lunchy.data.interfaces.ILunchyUser;
import lunchy.data.interfaces.ILunchyUsersDAO;
import lunchy.main.CLunchyApplication;

public class CLunchyLoginDialogModel
{
	public boolean login(String login, String password)
	{
		ILunchyUsersDAO usersConnection = CLunchyApplication.getInstance().dataConnection.getUsersDAO();
		
		ILunchyUser user = usersConnection.login(login, password);
		
		if(user != null)
		{
			CLunchyApplication.getInstance().currentUser = user;
			return true;
		}
		else
			return false;
	}

}
